import Vue from 'vue'
import App from './App.vue'
import router from "@/router";
import * as API from "@/api";
import 'swiper/swiper-bundle.css';
// 在 main.js 中引入
import '@/assets/font/font.css' // 引入字体样式
import store from "@/store";

import {
  Container,
  Header,
  Main,
  Aside,
  Footer,

  Row,
  Col,

  Form,
  Input,
  Select,
  Radio,
  FormItem,
  Option,
  DatePicker,
  TimePicker,
  Switch,
  Checkbox,
  CheckboxGroup,
  RadioGroup,

  Dropdown,
  DropdownMenu,
  DropdownItem,

  Menu,
  Submenu,
  MenuItemGroup,
  MenuItem,
  Button,
  MessageBox,
  Message,

  Pagination,
  Table,
  TableColumn,
  Descriptions,
  DescriptionsItem,
  Tag,
  Tabs,
  TabPane,
  Divider,
  Upload,
  Image,
  Dialog,
  Collapse,
  CollapseItem,
  Link,
  Tooltip,
  Loading

} from 'element-ui';

Vue.config.productionTip = false

Vue.component(Container.name,Container)
Vue.component(Aside.name,Aside)
Vue.component(Header.name,Header)
Vue.component(Main.name,Main)
Vue.component(Footer.name,Footer)

Vue.component(Row.name,Row)
Vue.component(Col.name,Col)

Vue.component(Form.name,Form)
Vue.component(Input.name,Input)
Vue.component(Select.name,Select)
Vue.component(Radio.name,Radio)
Vue.component(FormItem.name,FormItem)
Vue.component(Option.name,Option)
Vue.component(DatePicker.name,DatePicker)
Vue.component(TimePicker.name,TimePicker)
Vue.component(Switch.name,Switch)
Vue.component(Checkbox.name,Checkbox)
Vue.component(CheckboxGroup.name,CheckboxGroup)
Vue.component(RadioGroup.name,RadioGroup)

Vue.component(Dropdown.name,Dropdown)
Vue.component(DropdownMenu.name,DropdownMenu)
Vue.component(DropdownItem.name,DropdownItem)


Vue.component(Menu.name,Menu)
Vue.component(Submenu.name,Submenu)
Vue.component(MenuItemGroup.name,MenuItemGroup)
Vue.component(MenuItem.name,MenuItem)
Vue.component(Button.name,Button)
Vue.component(MessageBox.name,MessageBox)
Vue.component(Message.name,Message)
Vue.component(Pagination.name,Pagination)
Vue.component(Table.name,Table)
Vue.component(TableColumn.name,TableColumn)
Vue.component(Descriptions.name,Descriptions)
Vue.component(DescriptionsItem.name,DescriptionsItem)
Vue.component(Tag.name,Tag)
Vue.component(Tabs.name,Tabs)
Vue.component(TabPane.name,TabPane)
Vue.component(Divider.name,Divider)
Vue.component(Upload.name,Upload)
Vue.component(Image.name,Image)
Vue.component(Dialog.name,Dialog)
Vue.component(Collapse.name,Collapse)
Vue.component(CollapseItem.name,CollapseItem)
Vue.component(Link.name,Link)
Vue.component(Tooltip.name,Tooltip)


new Vue({
  render: h => h(App),
  router,
  store,
  beforeCreate(){
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;   //所有的请求接口统一接收到了，且挂载在Vue.prototype原型对象上
    Vue.prototype.$message = Message;
    Vue.prototype.$confirm = MessageBox.confirm;
    Vue.prototype.$prompt = MessageBox.prompt;
    Vue.prototype.$alert = MessageBox.alert;
    Vue.prototype.$loading = Loading.service;
  }
}).$mount('#app')
